// #背景音乐
window.bgSound = new Audio("/bg.mp3?v=1.0.0");
window.bgSound.loop = true;
document.addEventListener("WeixinJSBridgeReady", function () {
    window.bgSound.play();
});
document.addEventListener("touchstart", function (e) {
    window.bgSound.play();
});


// #隐藏微信分享
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() { window.WeixinJSBridge.call('hideOptionMenu') })

// #全局缓存openid
const search: any = new URLSearchParams(location.search);
const openid =
    search?.get('openId') ||
    search?.get('openid') ||
    localStorage.getItem('openId') || localStorage.getItem('openid');
openid && localStorage.setItem('openId', openid);

// #初始化远程调试
if (window.PageSpy) {
    window.$pageSpy = new window.PageSpy({
        api: "log.hawnlink.cn",
        clientOrigin: "https://log.hawnlink.cn",
        project: '百多邦&迪士尼',
        title: `OpenId: ${openid}`,
        autoRender: false
    });
}


